
#include"process.h"
#define STYLE '='
#define NUM 101
void  fflushprocess(double current,double total){
    char buffer[NUM];
     const char *flag="|/-\\";
     static int pos=0;
     int len=strlen(flag);
    memset(buffer,0,NUM*sizeof(char));
    int num=(int)(current*100/total);
    for(int i=0;i<num;i++) buffer[i]=STYLE;
     pos%=len;
    double rate=current/total;
       printf("[%-100s][%.1f%%][%c]\r", buffer, rate*100, flag[pos]);
    pos++;
    fflush(stdout);

     
}








